package com.starblink.imgsearch.findsimilar.ui.cell

import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.starblink.android.basic.adapter.BaseBindingVH
import com.starblink.android.basic.adapter.BaseVH
import com.starblink.android.basic.extension.dp2px
import com.starblink.imgsearch.databinding.CellSimilarEmptyBodyBinding
import com.starblink.imgsearch.findsimilar.data.SimilarEmptyBodyModel
import com.starblink.imgsearch.findsimilar.data.SimilarLoadingModel

internal class LoadingHeadCell(viewGroup: ViewGroup) :
    BaseVH<SimilarLoadingModel>(View(viewGroup.context).apply {
        layoutParams = StaggeredGridLayoutManager.LayoutParams(
            StaggeredGridLayoutManager.LayoutParams.MATCH_PARENT,
            StaggeredGridLayoutManager.LayoutParams.WRAP_CONTENT
        ).apply {
            isFullSpan = true
        }
    }) {
    override fun onBind(model: SimilarLoadingModel, position: Int) {

    }

}

/**
 * 找相似空
 */
internal class EmptyBodyCell(binding: CellSimilarEmptyBodyBinding) :
    BaseBindingVH<SimilarEmptyBodyModel, CellSimilarEmptyBodyBinding>(binding) {

    init {
        itemView.layoutParams =
            StaggeredGridLayoutManager.LayoutParams(
                StaggeredGridLayoutManager.LayoutParams.MATCH_PARENT,
                StaggeredGridLayoutManager.LayoutParams.WRAP_CONTENT
            ).apply {
                isFullSpan = true
                topMargin = 20.dp2px()
            }
    }

    override fun onBind(model: SimilarEmptyBodyModel, position: Int) {

    }

}